<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - 智能驾驶辅助系统</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body class="bg-gray-100 min-h-screen">
    <div class="container mx-auto px-4 py-12 max-w-md">
        <div class="bg-white rounded-lg shadow-lg p-8">
            <h1 class="text-2xl font-bold text-center mb-6">智能驾驶辅助系统</h1>
            <h2 class="text-xl font-semibold mb-6 text-center">用户登录</h2>

            {% if error %}
            <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
                {{ error }}
            </div>
            {% endif %}

            <form method="post">
                <div class="mb-4">
                    <label class="block text-gray-700 mb-2" for="username">
                        用户名
                    </label>
                    <input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
                           id="username" name="username" type="text" required>
                </div>
                <div class="mb-6">
                    <label class="block text-gray-700 mb-2" for="password">
                        密码
                    </label>
                    <input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
                           id="password" name="password" type="password" required>
                </div>
                <div class="flex items-center justify-between">
                    <button class="bg-primary hover:bg-primary/80 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
                            type="submit">
                        登录
                    </button>
                    <a class="inline-block align-baseline font-bold text-sm text-primary hover:text-primary/80"
                       href="/register">
                        注册新账号
                    </a>
                </div>
            </form>
        </div>
    </div>
</body>
</html>